home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / gamesrc / fring11 / pack.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-12-17  |  2.6 KB  |  88 lines

  1. {
  2. ***************************************************************************
  3. * PACK! - for (2/12/92)                                                   *
  4. * FRINGDUS - The Game.                                                    *
  5. *                                                                         *
  6. *  By Jason Nunn (JsNO BAR----NUNN)                                       *
  7. *                                                                         *
  8. * Email: nunn@pandanus.cs.ntu.edu.au                                      *
  9. *                                                                         *
  10. ***************************************************************************
  11. }
  12. program pack;
  13.  
  14. var
  15.   bigpic_file   : file;
  16.   pic_file      : file;
  17.   pack_ini      : text;
  18.   pic_file_name : string[15];
  19.   pic_buff      : array[0..899] of byte;
  20.   nr, nw        : word;
  21.  
  22. {
  23. ***************************************************************************
  24. *                                                                         *
  25. ***************************************************************************
  26. }
  27.  
  28. begin
  29.   if paramstr(1) = '-h' then
  30.   begin
  31.     writeln;
  32.     writeln('PACK - By Jason Nunn - (C) 1992 - This Game is Freeware');
  33.     writeln;
  34.     writeln('Instructions: Read Manual (readme.txt)');
  35.     writeln;
  36.   end
  37.   else
  38.   begin
  39.     assign(bigpic_file, 'fringpc1.pic');
  40.     {$I-}
  41.     rewrite(bigpic_file, 1);
  42.     {$I+}
  43.     if ioresult = 0 then
  44.     begin
  45.       assign(pack_ini, 'pack.ini');
  46.       {$I-}
  47.       reset(pack_ini);
  48.       {$I+}
  49.       if ioresult = 0 then
  50.       begin
  51.         writeln('PACKING...sprite files...');
  52.  
  53.         while not eof(pack_ini) do
  54.         begin
  55.           readln(pack_ini, pic_file_name);
  56.           if (pic_file_name <> '') and (pic_file_name[1] <> '#') then
  57.           begin
  58.             writeln(pic_file_name, ' -> ', 'fringpc1.pic');
  59.             assign(pic_file, pic_file_name);
  60.             {$I-}
  61.             reset(pic_file, 1);
  62.             {$I+}
  63.             if ioresult = 0 then
  64.             begin
  65.               blockread(pic_file, pic_buff, sizeof(pic_buff), nr);
  66.               blockwrite(bigpic_file, pic_buff, nr, nw);
  67.               close(pic_file);
  68.             end
  69.             else
  70.             begin
  71.               write('  FILE DOESN`T EXIST! (ABEND)');
  72.               writeln;
  73.               halt;
  74.             end;
  75.           end
  76.         end;
  77.         close(pack_ini);
  78.         writeln;
  79.         writeln('Done!');
  80.       end
  81.       else
  82.       begin
  83.         writeln('PACK.INI Not found');
  84.       end
  85.     end
  86.   end
  87. end.
  88.